package com.yunpuvip.sachet.modular.timer;

import com.yunpuvip.sachet.biz.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @ auther wushaohong
 * @ date  2019/8/19
 **/
@Component
@Slf4j
public class OrderTimer {

    @Autowired
    private OrderService orderService;
    /**
     * 定时修改订单状态
     */
    @Scheduled(fixedRate = 1 * 1000 * 60)
    private void updateActivityStatus(){
        log.info("定时修改过期订单状态开始");
        orderService.updateExpiredOrder();
        log.info("定时修改过期订单状态结束");

    }
}
